package com.examlpe.rabbitmqdome.listener;

import com.examlpe.rabbitmqdome.constant.Contants;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class DirectListener {
    @RabbitListener(queues = Contants.DIRECT_QUEUE1)
    public void queueListener1(String message) {
        System.out.println("lister 1 [" + Contants.DIRECT_QUEUE1+"]接收的消息: " +message);
    }
    @RabbitListener(queues = Contants.DIRECT_QUEUE2)
    public void queueListener2(String message) {
        System.out.println("lister 1 [" + Contants.DIRECT_QUEUE2+"]接收的消息: " +message);
    }
}
